import SequenceNode from './SequenceNode';
import SelectorNode from './SelectorNode';
import ActionNode from './ActionNode';
import ConditionNode from './ConditionNode';
import DecoratorNode from './DecoratorNode';
import { NodeType } from '../../types/behaviorTree';

/**
 * 节点类型到 React 组件的映射
 * 用于 React Flow 的 nodeTypes prop
 * 在组件外部定义以确保引用稳定，避免不必要的重新渲染
 */
export const nodeTypes = {
  [NodeType.Sequence]: SequenceNode,
  [NodeType.Selector]: SelectorNode,
  [NodeType.Action]: ActionNode,
  [NodeType.Condition]: ConditionNode,
  [NodeType.Decorator]: DecoratorNode,
} as const;

